<!DOCTYPE html>
<html>
<head> 
<script type="text/javascript" src="js/MD5.js"></script> 
</head>
<body background="img/bk1.jpg";>

<h1 style="text-align:center;font-family:arial;color:block;letter-spacing:2px;"><font size="50">小学生答题测试系统</font></h1>
	<p style="text-align:center;word-spacing:5px">
	<font size="6">
    <a href="/introduce.html">首页</a>&nbsp;
    <a href="/classes.html">教学班</a>&nbsp;&nbsp;
    <a href="/student.html">学生</a>&nbsp;&nbsp;
    <a href="/teacher.html">老师</a>&nbsp;&nbsp;
    <a href="/course.html">课程</a>&nbsp;&nbsp;
    <a href="/question.html">题库</a>&nbsp;&nbsp;
    <a href="/exam.html">测验</a>&nbsp;&nbsp;
    <a href="/loginUser.html">登录</a>&nbsp;&nbsp;
    <a href="/logout.html">退出</a>&nbsp;&nbsp;
    </font>
    </p>

<br><br><br>
<div class="tab">
  <button class="tablinks" onclick="login(event, 'teacher')">teacher</button>
  <button class="tablinks" onclick="login(event, 'student')">student</button>
</div>

<div id="teacher" class="tabcontent" style="width:100%;text-align:center" font size="50">
  <form  method="post" action="teacher_login">
老师工号: <input type="text"  name="teacherNumber"><br><br>
密码: <input type="password"  id="tcpassword"  name="teacherPassword1"><br><br>                          
<input type="hidden"  id="password2" name="teacherPassword"><br><br>
<input type="submit" value="登陆" onclick="md5()">
</form>
</div>

<div id="student" class="tabcontent" style="width:100%;text-align:center" font size="50">
 <form  method="post" action="student_login">
学生学号: <input type="text"  name="studentNumber"><br><br>
密码: <input type="password" id="stpassword"  name="studentPassword1"><br><br>                          
<input type="hidden"  id="password3" name="studentPassword"><br><br>
<input type="submit" value="登陆" onclick="md6()">
</form>
</div>

<style>
body {font-family: "Lato", sans-serif;}

/* Style the tab */
div.tab {
    overflow: hidden;
    border: 1px solid #ccc;
    background-color: #f1f1f1;
}

/* Style the buttons inside the tab */
div.tab button {
    background-color: inherit;
    float: left;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 12px 1px;
    transition: 0.3s;
    font-size: 20px;
    width: 50%;
}

/* Change background color of buttons on hover */
div.tab button:hover {
    background-color: #ddd;
}

/* Create an active/current tablink class */
div.tab button.active {
    background-color: #ccc;
}

/* Style the tab content */
.tabcontent {
    display: none;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-top: none;
}
</style>
<script type="text/javascript">
function login(evt, UserName) {
    var i, tabcontent, tablinks;
    tabcontent = document.getElementsByClassName("tabcontent");
    for (i = 0; i < tabcontent.length; i++) {
        tabcontent[i].style.display = "none";//隐藏
    }
    tablinks = document.getElementsByClassName("tablinks");
    for (i = 0; i < tablinks.length; i++) {
        tablinks[i].className = tablinks[i].className.replace(" active", "");
    }
    document.getElementById(UserName).style.display = "block";//显示出来
    evt.currentTarget.className += " active";
}
function md5(){
  var Password = hex_md5(document.getElementById("tcpassword"));
  document.getElementById("password2").value=Password;
}
function md6(){
  var Password = hex_md5(document.getElementById("stpassword"));
  document.getElementById("password3").value=Password;
}
</script>
